<!DOCTYPE html>

<html>

	<head>
		<style>
			body {
				/* set margin to 0 and overflow to hidden, to go fullscreen */
				margin: 0;
				overflow: hidden;
				background-color: #000000;
			}
		</style>

		<title>Lane-Assist-Prototyp_a01</title>
		<!--Include von jQuery-->
		<script type="text/javascript" src="libs/jquery-1.9.0.js"></script>
		<!--Include von Three.js-->
		<script type="text/javascript" src="libs/three.js"></script>
		<!--Include von Statsjs zur Kontrolle der FPS-->
		<script type="text/javascript" src="libs/stats.js"></script>
		<!--Include von Physijs zur Physiksimulation-->
		<script type="text/javascript" src="libs/physi.js"></script>
		<!--Include von DatGui zur Kontrolle der Eingabeparameter-->
		<script type="text/javascript" src="libs/dat.gui.js"></script>
		<!-- Include der Chroma.js-Libary zur Farbverwaltung-->
		<script type="text/javascript" src="libs/chroma.js"></script>
		<!-- Include spezifischer Kamerasteuerung-->
		<script type="text/javascript" src="libs/OrbitControls.js"></script>
		<!-- Include von Standardmaterialien in Form von Three.js-Materialien-->
		<script type="text/javascript" src="libs/MatLibThree.js"></script>
		<!-- Include von Standardmaterialien in Form von physi.js-Materialien-->
		<script type="text/javascript" src="libs/MatLibPhysi.js"></script>
		<!-- Include von KeyboardState.js zur Aufnahme von Tastatureingaben-->
		<script type="text/javascript" src='libs/THREEx.KeyboardState.js'></script>
		<!-- Include von Tween.js zur Aufnahme von Tastatureingaben-->
		<script type="text/javascript" src='libs/Tween.js'></script>

		<!-- Include von fahrzeug.js-->
		<script type="text/javascript" src='js/renderer.js'></script>
		<!-- Include von fahrzeug.js-->
		<script type="text/javascript" src="libs/JSONLoader.js"></script>
		<!-- Include von fahrzeug.js-->
		<script type="text/javascript" src='js/fahrzeug.js'></script>
		<!-- Include von fahrzeug.js-->
		<script type="text/javascript" src='js/fahrverhalten.js'></script>
		<!-- Include von fahrzeug.js-->
		<script type="text/javascript" src='js/umgebung.js'></script>
		<!-- Include von skybox.js-->
		<script type="text/javascript" src='js/skybox.js'></script>
		<!-- Include von skybox.js-->
		<script type="text/javascript" src='js/verfolgerLicht.js'></script>
		<!-- Include von skybox.js-->
		<script type="text/javascript" src='js/hemisphaerenLicht.js'></script>
		<!-- Include von main.js-->
		<script type="text/javascript" src='js/main.js'></script>
		<!-- Include von main.js-->
		<script type="text/javascript" src='js/abschnittsTrigger.js'></script>

		<!-- //////////////Postprocessing-Imports////////////////////////-->
		<!-- Include von EffectComposer.js-->
		<script type="text/javascript" src="libs/EffectComposer.js"></script>
		<!-- Include von ShaderPass.js-->
		<script type="text/javascript" src="libs/ShaderPass.js"></script>
		<!-- Include von RenderPass.js-->
		<script type="text/javascript" src="libs/RenderPass.js"></script>
		<!-- Include von MaskPass.js-->
		<script type="text/javascript" src="libs/MaskPass.js"></script>
		<!-- Include von CopyShader.js-->
		<script type="text/javascript" src="libs/CopyShader.js"></script>

		<!-- Include von BleachBypassShader.js-->
		<script type="text/javascript" src="libs/shaders/BleachBypassShader.js"></script>
		<!-- Include von FXAAShader.js-->
		<script type="text/javascript" src="libs/shaders/FXAAShader.js"></script>
		<!-- Include von FocusShader.js-->
		<script type="text/javascript" src="libs/shaders/FocusShader.js"></script>
		<!-- Include von VignetteShader.js-->
		<script type="text/javascript" src="libs/shaders/VignetteShader.js"></script>
		<!-- Include SSAOShader-->
		<script type="text/javascript" src="libs/shaders/SSAOShader.js"></script>

		<!--Include von jQuery-->
		<script type="text/javascript" src="js/iifeTest.js"></script>
		<!--Include von jQuery-->
		<script type="text/javascript" src="libs/AnaglyphEffect.js"></script>
		

		<!--Source-Code der Main aufrufen-->
		<script type="text/javascript">
			'use strict';
			// Zum Beginn initScene aufrufen
			$(document).ready(function() {
				init();

				document.getElementById('viewport').addEventListener("contextmenu", function(event) {
					event.preventDefault();

				});

				var mouseDown = false;

				document.getElementById('viewport').addEventListener("mousedown", function(event) {
					mouseDown = true;
					switch (event.which) {
						case 1:
							laneAssist.laneAssistAktiv = false;
							blinker_links = true;
							blinker_rechts = false;
							blinkerVorneSprite_links.visible = true;
							blinkerSeiteSprite_links.visible = true;
							blinkerHintenSprite_links.visible = true;
							
							console.log(document.getElementById("viewport"));

							
							break;
						case 2:
							blinker_links = false;
							blinker_rechts = false;
							break;
						case 3:
							laneAssist.laneAssistAktiv = false;
							blinker_links = false;
							blinker_rechts = true;
							blinkerVorneSprite_rechts.visible = true;
							blinkerSeiteSprite_rechts.visible = true;
							blinkerHintenSprite_rechts.visible = true;
							break;
						default:
							console.log('Undefinierte Maustaste');
					}
				});
				document.getElementById('viewport').addEventListener("mouseup", function(event) {
					mouseDown = false;

					blinkerVorneSprite_rechts.visible = false;
					blinkerSeiteSprite_rechts.visible = false;
					blinkerHintenSprite_rechts.visible = false;

					blinkerVorneSprite_links.visible = false;
					blinkerSeiteSprite_links.visible = false;
					blinkerHintenSprite_links.visible = false;

					switch (event.which) {
						case 1:
							zuNullLenken();
							blinker_links = false;
							blinker_rechts = false;
							break;
						case 2:
							blinker_links = false;
							blinker_rechts = false;
							break;
						case 3:
							zuNullLenken();
							blinker_links = false;
							blinker_rechts = false;
							break;
						default:
							console.log('Undefinierte Maustaste');
					}
				});

				$(window).bind('mousewheel', function(event) {
					if (event.originalEvent.wheelDelta >= 0) {
						beschleunigen();
					} else {
						abbremsen();
					}
				});
			});
		</script>
	</head>

	<body>
			<div id="viewport" style="z-index:0">
				<div style="position:absolute; bottom:20px;right:20px;font-family:sans-serif;font-size:5em; color:white; z-index:0;">
					<span id="geschwindigkeit"></span>
				</div>
			</div>


	</body>

</html>
